package DatabaseHelper;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public abstract class Data extends SQLiteOpenHelper  {

	public Data(Context context,String databaseName,int version)
	{
		super(context, databaseName, null, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(getCreateStatement());
		//		db.execSQL(getCreateStatement2());  //cai tien
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		Log.w(LisMocDatabase.class.getName(),
				"Upgrading database from version " + oldVersion + " to "
						+ newVersion + ", which will destroy all old data");
		db.execSQL("DROP TABLE IF EXISTS " + getTableName());
		//		db.execSQL("DROP TABLE IF EXISTS " + getTableName2());  // cai tien
		onCreate(db);
	}

	protected abstract String getCreateStatement();
	//	protected abstract String getCreateStatement2(); //cai tien
	protected abstract String getTableName();
	//	protected abstract String getTableName2();  //cai tien
}
